package com.ambulance.project.biz.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 调度记录基本信息表
 * </p>
 *
 * @author zr
 * @since 2020-04-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("biz_dispatch")
@ApiModel(value="Dispatch对象", description="调度记录基本信息表")
public class Dispatch extends Model<Dispatch> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "调度标识")
    @TableId(value = "dispatchID", type = IdType.AUTO)
    private Integer dispatchID;

    @ApiModelProperty(value = "车辆ID")
    @TableField("carID")
    private Integer carID;

    @ApiModelProperty(value = "0未结束，1已结束")
    @TableField("is_over")
    private Integer isOver;

    @ApiModelProperty(value = "班组ID")
    @TableField("classID")
    private Integer classID;

    @ApiModelProperty(value = "医生ID")
    @TableField("doctorID")
    private Integer doctorID;

    @ApiModelProperty(value = "护士ID")
    @TableField("nurseID")
    private Integer nurseID;

    @ApiModelProperty(value = "病人ID")
    @TableField("patientID")
    private Integer patientID;

    @ApiModelProperty(value = "司机ID")
    @TableField("driverID")
    private Integer driverID;

    @ApiModelProperty(value = "收治医院名称")
    @TableField("hospital")
    private String hospital;

    @ApiModelProperty(value = "接警时间")
    @TableField("receive_help_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime receiveHelpTime;

    @ApiModelProperty(value = "调度时间")
    @TableField("dispatch_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime dispatchTime;

    @ApiModelProperty(value = "出车时间")
    @TableField("leave_hosp_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime leaveHospTime;

    @ApiModelProperty(value = "到达时间")
    @TableField("arrive_dest_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime arriveDestTime;

    @ApiModelProperty(value = "离开时间")
    @TableField("leave_dest_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime leaveDestTime;

    @ApiModelProperty(value = "到达患者备注")
    @TableField("arrive_dest_content")
    private String arriveDestContent;

    @ApiModelProperty(value = "到达医院时间")
    @TableField("arrive_host_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime arriveHostTime;

    @ApiModelProperty(value = "到达医院备注")
    @TableField("arrive_hosp")
    private String arriveHosp;

    @ApiModelProperty(value = "会诊开始")
    @TableField("treat_start")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime treatStart;

    @ApiModelProperty(value = "会诊结合")
    @TableField("treat_end")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime treatEnd;

    @ApiModelProperty(value = "会诊内容")
    @TableField("treat_content")
    private String treatContent;

    @ApiModelProperty(value = "通话指导开始时间")
    @TableField("guide_start")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime guideStart;

    @ApiModelProperty(value = "指导结束时间")
    @TableField("guide_end")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime guideEnd;

    @ApiModelProperty(value = "通话时长s")
    @TableField("phone_guide_use_time")
    private Integer phoneGuideUseTime;

    @ApiModelProperty(value = "指导内容")
    @TableField("guide_content")
    private String guideContent;

    @ApiModelProperty(value = "用药开始")
    @TableField("medicine_start")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime medicineStart;

    @ApiModelProperty(value = "用药结束")
    @TableField("medicine_end")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime medicineEnd;

    @ApiModelProperty(value = "调度状态0接警，1出车，2通话指导，3到达现场，4上车转运，5发起会诊，6溶栓开始7溶栓结束，8到达医院")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "是否会诊 (0=否 1=是)")
    @TableField("is_consultation")
    private Integer isConsultation;

    @ApiModelProperty(value = "车牌号")
    @TableField("vin")
    private String vin;

    @ApiModelProperty(value = "车辆类型 0普通救护车/1卒中救护车")
    @TableField("car_type")
    private Integer carType;

    @ApiModelProperty(value = "医生姓名")
    @TableField("doctor_name")
    private String doctorName;

    @ApiModelProperty(value = "患者姓名")
    @TableField("patient_name")
    private String patientName;

    @ApiModelProperty(value = "患者身份证信息")
    @TableField("patient_card")
    private String patientCard;

    @ApiModelProperty(value = "司机电话")
    @TableField("driver_phone")
    private String driverPhone;

    @ApiModelProperty(value = "医生电话")
    @TableField("doctor_phone")
    private String doctorPhone;

    @ApiModelProperty(value = "司机姓名")
    @TableField("driver_name")
    private String driverName;

    @ApiModelProperty(value = "来电类型")
    @TableField("phone_type")
    private Integer phoneType;

    @ApiModelProperty(value = "医院标识")
    @TableField("uid")
    private Integer uid;

    @ApiModelProperty(value = "调度流水")
    @TableField("flow")
    private String flow;

    @ApiModelProperty(value = "取消派车时间")
    @TableField("cancel_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime cancelTime;


    @ApiModelProperty(value = "取消派车原因")
    @TableField("cancel_reason")
    private String cancelReason;

    @ApiModelProperty(value = "取消标识")
    @TableField("cancel")
    private Integer cancel;

    @ApiModelProperty(value = "汇声收流地址")
    @TableField("hs_rtmp")
    private String hsRtmp;

    @ApiModelProperty(value = "车载设备编号")
    @TableField("car_device_id")
    private String carDeviceId;

    @ApiModelProperty(value = "汇声标识")
    @TableField("hs_status")
    private Integer hsStatus;

    @JsonIgnore
    @ApiModelProperty(value = "出车时间")
    @TableField("on_car_time")
    private Long onCarTime;

    @JsonIgnore
    @ApiModelProperty(value = "救治时间")
    @TableField("on_help_time")
    private Long onHelpTime;

    @JsonIgnore
    @ApiModelProperty(value = "汇声录播地址")
    @TableField("hs_video_url")
    private String hsVideoUrl;

    @Override
    protected Serializable pkVal() {
        return this.dispatchID;
    }

}
